package com.example.sofclick;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class TabGroupActivity extends TabActivity{
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabgroup);
        
        TabHost tabHost = getTabHost();
        
        // Tab for Faults
        TabSpec faultspec = tabHost.newTabSpec("Faults");
        faultspec.setIndicator("Faults", getResources().getDrawable(R.drawable.icon_faults_tab));
        Intent faultsIntent = new Intent(this, FaultsActivity.class);
        faultspec.setContent(faultsIntent);
        
        // Tab for Notes
        TabSpec notespec = tabHost.newTabSpec("Notes");
        // setting Title and Icon for the Tab
        notespec.setIndicator("Notes", getResources().getDrawable(R.drawable.icon_notes_tab));
        Intent notesIntent = new Intent(this, MainActivity.class);
        notespec.setContent(notesIntent);
        
        // Tab for Tab3
        TabSpec tab3spec = tabHost.newTabSpec("Tab3");
        tab3spec.setIndicator("Tab3", getResources().getDrawable(R.drawable.icon_tab3_tab));
        Intent tab3Intent = new Intent(this, Tab3Activity.class);
        tab3spec.setContent(tab3Intent);
        
        // Adding all TabSpec to TabHost
        tabHost.addTab(faultspec); // Adding faults tab
        tabHost.addTab(notespec); // Adding notes tab
        tabHost.addTab(tab3spec); // Adding tab3 tab
    }
}
